ls
wc
source("C:\\Rtools\\bin\\wc.exe")
wc
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/1")
data_1<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/2")
data_2<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/3")
data_3<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/4")
data_4<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/5")
data_5<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/6")
data_6<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/7")
data_7<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/8")
data_8<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/9")
data_9<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/10")
data_10<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/11")
data_11<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/12")
data_12<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/13")
data_13<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/14")
data_14<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/15")
data_15<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/16")
data_16<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/17")
data_17<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/18")
data_18<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/19")
data_19<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/20")
data_20<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/21")
data_21<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/22")
data_22<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/23")
data_23<-read.table("normalize.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/24")
data_24<-read.table("normalize.txt",sep="\t",head=T)
dataF<-as.matrix(cbind(data_1[,1:5],data_2[,1:5],data_3[,1:5],data_4[,1:5],data_5[,1:5],data_6[,1:5],data_7[,1:5],data_8[,1:5],data_9[,1:5],data_10[,1:5],data_11[,1:5],data_12[,1:5],data_13[,1:5],data_14[,1:5],data_15[,1:5],data_16[,1:5],data_17[,1:5],data_18[,1:5],data_19[,1:5],data_20[,1:5],data_21[,1:5],data_22[,1:5],data_23[,1:5],data_24[,1:5]))
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/residualplot/plot4_inputs")
data<-read.table("rma_normalizaed.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/whole_rma/all")
data_frma_single<-read.table("normalized_frma_single.txt",sep="\t",head=T)
library(affycoretools)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/residualplot/plot4_inputs")
 pdf("pcaplot_rma_frmaBatch_frmaSingle.pdf")
 plotPCA(as.matrix(data),groups=c(1:120),xlim = c(-150,150),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"),legend=c("sample1","sample2","sample3","sample4"))
 plotPCA(as.matrix(dataF),groups=c(1:120),xlim = c(-150,150),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"),legend=c("sample1","sample2","sample3","sample4"))
 plotPCA(as.matrix(data_frma_single),groups=c(1:120),xlim = c(-150,150),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"),legend=c("sample1","sample2","sample3","sample4"))
 dev.off()
 pdf("pcaplot_rma_frmaBatch_frmaSingle.pdf")
 plotPCA(as.matrix(data),groups=c(1:120),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"),legend=c("sample1","sample2","sample3","sample4"))
 plotPCA(as.matrix(dataF),groups=c(1:120),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"),legend=c("sample1","sample2","sample3","sample4"))
 plotPCA(as.matrix(data_frma_single),groups=c(1:120),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"),legend=c("sample1","sample2","sample3","sample4"))
 dev.off()
pdf("pcaplot_rma_frmaBatch_frmaSingle.pdf")
 plotPCA(as.matrix(data),xlim=c(-150,150),groups=c(1:120),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"))
 plotPCA(as.matrix(dataF),groups=c(1:120),xlim=c(-150,150),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"))
 plotPCA(as.matrix(data_frma_single),groups=c(1:120),xlim=c(-150,150),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"))
 dev.off()
 pdf("pcaplot_rma_frmaBatch_frmaSingle.pdf")
 plotPCA(as.matrix(data),groups=c(1:120),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"))
 dev.off()
 pdf("pcaplot_rma_frmaBatch_frmaSingle.pdf")
 plotPCA(as.matrix(data),groups=c(1:120),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"))
plotPCA(as.matrix(dataF),groups=c(1:120),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"))
plotPCA(as.matrix(data_frma_single),groups=c(1:120),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"))
 dev.off()
?plotPCA
pdf("pcaplot_rma_frmaBatch_frmaSingle_1.pdf")
 plotPCA(as.matrix(data),groups=c(1:120),xlim=c(-150,150),ylim=c(-40,100),addtext=c("1_1","1_1","1_1","1_1","1_1","2_1","2_1","2_1","2_1","2_1","3_1","3_1","3_1","3_1","3_1","4_1","4_1","4_1","4_1","4_1","1_2","1_2","1_2","1_2","1_2","2_2","2_2","2_2","2_2","2_2","3_2","3_2","3_2","3_2","3_2","4_2","4_2","4_2","4_2","4_2","1_3","1_3","1_3","1_3","1_3","2_3","2_3","2_3","2_3","2_3","3_3","3_3","3_3","3_3","3_3","4_3","4_3","4_3","4_3","4_3","1_4","1_4","1_4","1_4","1_4","2_4","2_4","2_4","2_4","2_4","3_4","3_4","3_4","3_4","3_4","4_4","4_4","4_4","4_4","4_4","1_5","1_5","1_5","1_5","1_5","2_5","2_5","2_5","2_5","2_5","3_5","3_5","3_5","3_5","3_5","4_5","4_5","4_5","4_5","4_5","1_6","1_6","1_6","1_6","1_6","2_6","2_6","2_6","2_6","2_6","3_6","3_6","3_6","3_6","3_6","4_6","4_6","4_6","4_6","4_6"),pch=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6),col=c("red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple","red","red","red","red","red","blue","blue","blue","blue","blue","green","green","green","green","green","purple","purple","purple","purple","purple"))
dim(data)
dim(dataF)
dim(data_frma_single)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/residualplot")
data_rtpcr<-read.table("taqman_residual_graph_input.txt",sep="\t",head=T)
setwd("A:/data_HTHGU/maqc/affy_plus2_taqman/residualplot/plot4_inputs")
selected.rows<-rownames(data_rtpcr)
data_new<-data[selected.rows,]
selected.rows[1]
data_new[1,]
dataF_new<-dataF[selected.rows,]
data_frma_single_new<-data_frma_single[selected.rows,]
library(quantreg)
library(affy)
mat_A<-as.matrix(cbind(data_new[,1:5],data_new[,21:25],data_new[,41:45],data_new[,61:65],data_new[,81:85],data_new[,101:105]))
A<-apply(mat_A,1,robustmean)
robustmean <- function(x) { tukey.biweight(x, c = 5, epsilon = 1e-04)}
A<-apply(mat_A,1,robustmean)
mat_AF<-as.matrix(cbind(dataF_new[,1:5],dataF_new[,21:25],dataF_new[,41:45],dataF_new[,61:65],dataF_new[,81:85],dataF_new[,101:105]))
AF<-apply(mat_AF,1,robustmean)
mat_A_frma_single_new<-as.matrix(cbind(data_frma_single_new[,1:5],data_frma_single_new[,21:25],data_frma_single_new[,41:45],data_frma_single_new[,61:65],data_frma_single_new[,81:85],data_frma_single_new[,101:105]))
AFS<-apply(mat_A_frma_single_new,1,robustmean)
plot(log(data_rtpcr$A),A,  pch=".",xlab="RTPCR", ylab="RMA_FRMA_FRMASINGLE")
abline(lm(A~log(data_rtpcr$A)), col="black")
plot(log(data_rtpcr$A),A,  pch=".",xlab="RTPCR", ylab="RMA_FRMA_FRMASINGLE")
abline(lm(A~log(data_rtpcr$A)), col="black")
length(A)
length(data_rtpcr$A)
plot(log(data_rtpcr$A),A,  pch=".",xlab="RTPCR", ylab="RMA_FRMA_FRMASINGLE")
plot
dev.off
dev.off()
plot(log(data_rtpcr$A),A,  pch=".",xlab="RTPCR", ylab="RMA_FRMA_FRMASINGLE")
abline(lm(A~log(data_rtpcr$A)), col="black")
points(log(data_rtpcr$A),AF,  pch='.',col="red")
abline(lm(AF~log(data_rtpcr$A)), col="red")
points(log(data_rtpcr$A),AFS,  pch='.',col="blue")
abline(lm(AFS~log(data_rtpcr$A)), col="red")
abline(lm(AFS~log(data_rtpcr$A)), col="blue")
lines(lowess(log(data_rtpcr$A),A),col="black")
lines(lowess(log(data_rtpcr$A),AF),col="red")
lines(lowess(log(data_rtpcr$A),AFS),col="blue")
plot(log(data_rtpcr$A),A,  pch=".",xlab="RTPCR", ylab="RMA_FRMA_FRMASINGLE")
abline(lm(A~log(data_rtpcr$A)), col="black")
 points(log(data_rtpcr$A),AF,  pch='.',col="red")
 abline(lm(AF~log(data_rtpcr$A)), col="red")
 points(log(data_rtpcr$A),AFS,  pch='.',col="blue")
  abline(lm(AFS~log(data_rtpcr$A)), col="blue")
plot(log(data_rtpcr$A),A,  pch=1,xlab="RTPCR", ylab="RMA_FRMA_FRMASINGLE")
abline(lm(A~log(data_rtpcr$A)), col="black")
 points(log(data_rtpcr$A),AF,  pch=1,col="red")
 abline(lm(AF~log(data_rtpcr$A)), col="red")
 points(log(data_rtpcr$A),AFS,  pch=1,col="blue")
  abline(lm(AFS~log(data_rtpcr$A)), col="blue")
data_all<-cbind(data_rtpcr$A,A,AF,AFS)
colnames(data_all)<-cbind("orginal","rma","frma","frma_single")
library(Hmisc)
spearman<-rcorr(data_all,type="spearman")
spearman$r
